#define _CRT_SECURE_NO_WARNINGS 1




#include <stdio.h>

void Sort(int arr1[10], int arr2[10], int sz)
{
	int count = 0;
	int i = 0;

	for (i = 0; i < sz; i++)
	{

		if (1 == arr1[i] % 2)
		{
			arr2[count] = arr1[i];
			count++;
		}

	}

	for (i = 0; i < sz; i++)
	{

		if (0 == arr1[i] % 2)
		{
			arr2[count] = arr1[i];
			count++;
		}

	}

}

int main()
{
	int arr1[10] = { 0 };
	int arr2[10] = { 0 };
	int i = 0;
	int sz = sizeof(arr1) / sizeof(arr1[0]);

	for (i = 0; i < sz; i++)
	{
		scanf("%d", &arr1[i]);
	}

	Sort(arr1, arr2, sz);

	for (i = 0; i < sz; i++)
	{
		printf("%d ", arr2[i]);
	}

	return 0;
}